# Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
# Contributor: Jan de Groot <jgc@archlinux.org>
# Contributor: Ben <contrasutra@myrealbox.com>

pkgname=sound-juicer
pkgver=3.40.0
pkgrel=2
pkgdesc="A lean and friendly audio CD extractor for GNOME"
url="https://wiki.gnome.org/Apps/SoundJuicer"
arch=(loong64 x86_64)
license=(GPL)
depends=(
  brasero
  gst-plugins-base
  gst-plugins-good
  gtk3
  iso-codes
  libcanberra
  libdiscid
  libmusicbrainz5
)
makedepends=(
  appstream-glib
  git
  itstool
  meson
)
optdepends=(
  'gst-plugins-ugly: MP3 encoding support'
  'gst-plugins-bad: Opus encoding support'
)
_commit=799286c80b998b473309f39d296d918c187d66d7  # tags/3.40.0^0
source=("git+https://gitlab.gnome.org/GNOME/sound-juicer.git#commit=$_commit")
b2sums=('SKIP')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/[^-]*-g/r&/;s/-/+/g'
}

prepare() {
  cd $pkgname
}

build() {
  arch-meson $pkgname build
  meson compile -C build
}

check() {
  meson test -C build --print-errorlogs
}

package() {
  meson install -C build --destdir "$pkgdir"
}

# vim:set sw=2 sts=-1 et:
